﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="DisplayReviewFileSingle.aspx.cs" Inherits="CodeDemon.Views.Review.DisplayReviewFileSingle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<div class="jqmWindow" id="ex3"><div style=" text-align: center; margin: 100px 0 0 60px ; width:18em;"><img src="/CodeDemon/Content/spinner-big.gif" /><br/><br/><span class="loading">Loading...</span></div></div>
<% 
    var v = (from reviewFiles in ViewData.Model.DAO.GetReviewFilesByReviewFileId(ViewData.Model.CurrentReviewFileID) select reviewFiles).FirstOrDefault();
    var rev = (from reviews in ViewData.Model.DAO.GetReviewByReviewFileID(ViewData.Model.CurrentReviewFileID) select reviews).FirstOrDefault();

    %>
    <p>
        <img src="/CodeDemon/Content/icn_12_arrowleft.gif" style="border:none;" />&nbsp;<a href="/CodeDemon/Review/DisplayReview?reviewID=<%= rev.ReviewID %>">Return to Review</a>
    </p>
<%
 if (v.IsBinary == false)
        {
        %>
        
        <div>
            <a id="show<%= v.ReviewFileID %>"><img id="arrow<%= v.ReviewFileID %>" src="/CodeDemon/Content/arrow_closed.gif" style="border:none 0px" alt="Show" />&nbsp;&nbsp;<%=v.FilePath%></a>
            <a id="hide<%= v.ReviewFileID %>"><img id="arrow2<%= v.ReviewFileID %>" src="/CodeDemon/Content/arrow_open.gif" style="border:none 0px" alt="Hide" />&nbsp;&nbsp;<%=v.FilePath%></a> <% } else{ %><div><img src="/CodeDemon/Content/icon_binary.gif" style="border:none 0px" alt="Binary File" />&nbsp;&nbsp;<%=v.FilePath%>&nbsp;&nbsp;<% } %><img alt="Show Commit Log" id="logicon<%= v.ReviewFileID %>" src="/CodeDemon/Content/icn_annotation.gif" style="border:none 0px" />
             <img alt="Hide Commit Log" id="hidelogicon<%= v.ReviewFileID %>" src="/CodeDemon/Content/icn_annotation.gif" style="border:none 0px" />

             &nbsp; <a href="<%=ConfigurationManager.AppSettings["FishEyeRepoLookupURL"] %><%= v.RepositoryKey %><%=v.FilePath %>#r<%=v.EndRevision %>"><img alt="FishEye History" src="/CodeDemon/Content/icn_history.gif" style="border:none 0px" /></a>
                &nbsp;<a href="<%=ConfigurationManager.AppSettings["FishEyeRepoLookupURL"] %><%= v.RepositoryKey %><%=v.FilePath %>?r=<%=v.EndRevision %>"><img alt="FishEye Revision" src="/CodeDemon/Content/new_in_tab.gif" style="border:none 0px" /></a>
                &nbsp;<a onclick="this.target = '_blank';" href="<%=ConfigurationManager.AppSettings["NewDefectURL"] %>?product=SMARTworks%206.0&amp;version=unspecified&amp;rep_platform=---&amp;op_sys=Windows&amp;priority=P4&amp;bug_severity=normal&amp;target_milestone=---&amp;bug_status=NEW&amp;assigned_to=&amp;qa_contact=&amp;bug_file_loc=http%3A%2F%2F&amp;short_desc=Problem%20with%20<%=v.FilePath %>&amp;comment=&amp;keywords=&amp;status_whiteboard=&amp;dependson=&amp;blocked=<%= v.FileDefectNumber %>,<%= v.DefectNumber %>&amp;form_name=enter_bug"><img alt="Enter Bug" src="/CodeDemon/Content/bugzilla16.png" style="border:none 0px" /></a>
                &nbsp; <a href="<%=ConfigurationManager.AppSettings["FishEyeChangeLogURL"] %><%=v.EndRevision %>"><%=v.StartRevision %>-<%=v.EndRevision %></a> 
               <% if (v.ChangeAction == "M ")
                   { %>
                    <span class="filestatus">Modified</span>
                <% } %>
                <% if (v.ChangeAction == "D ")
                   { %>
                    <span class="filestatus">Deleted</span>
                <% } %>
                <% if (v.ChangeAction == "A ")
                   { %>
                    <span class="filestatus">Added</span>
                <% } %>  
        </div>
        <div id="msg<%= v.ReviewFileID %>" class="fileLogMsg">
            <span class="line">By <%= v.Author %> on <%= v.ChangeDate %></span>
            <pre class="line"><%= LinkLogMessage(v.LogMessage) %></pre></div> <% if (v.IsBinary == false)
                                                                                 { %>
        <div id="div<%= v.ReviewFileID %>"><img src="/CodeDemon/Content/spinner.gif" alt="Loading" />Loading Diff...</div>
        <script type="text/javascript">

             $(document).ready(function() {
                ReadyReviewFileSingle( '<%= v.ReviewFileID %>');
             });
            </script>
        <%
    }
    else
      {
      %>
       <script type="text/javascript">
        ReadyBinaryFile( '<%= v.ReviewFileID %>' );
       </script>
       <%
       }

        %>

</asp:Content>
